package com.changgou.service.goods.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.changgou.goods.pojo.Spec;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface SpecMapper extends BaseMapper<Spec> {
    @Select("select name, options from tb_spec where template_id in (select template_id from tb_category where name = #{name}) order by spec")
    List<Map> findListByCategoryName(@Param("name") String category);
}
